home *** CD-ROM | disk | FTP | other *** search
- '**************************************************************************
- '************************* Setup Detect API's ***************************
- '******* Edited by VAM of Ahead, Inc. to eliminate unused functions *******
- '**************************************************************************
-
- ''detect
-
- DECLARE FUNCTION CbGetIniKeyString LIB "msdetstf.dll" (szFile$, szSect$, szKey$, szBuf$, cbBuf%) AS INTEGER
- DECLARE FUNCTION WGetDOSMajorVersion LIB "msdetstf.dll" AS INTEGER
- DECLARE FUNCTION WGetDOSMinorVersion LIB "msdetstf.dll" AS INTEGER
- DECLARE FUNCTION FHasMouseInstalled LIB "msdetstf.dll" AS INTEGER
- DECLARE FUNCTION FDoesFileExist LIB "msdetstf.dll" (szFileName$, mode%) AS INTEGER
- DECLARE FUNCTION CbGetDateOfFile LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
- DECLARE FUNCTION FDoesIniSectionExist LIB "msdetstf.dll" (szFile$, szSect$) AS INTEGER
- DECLARE FUNCTION FDoesIniKeyExist LIB "msdetstf.dll" (szFile$, szSect$, szKey$) AS INTEGER
- DECLARE FUNCTION FIsValidDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
- DECLARE FUNCTION LcbFreeDrive LIB "msdetstf.dll" (nDrive%) AS LONG
- DECLARE FUNCTION FDirExists LIB "msdetstf.dll" (szDir$) AS INTEGER
-
-
- '*************************************************************************
- '**************** Detect Basic Wrapper Declarations ********************
- '*************************************************************************
-
-
- '' detect
-
- DECLARE FUNCTION IsDriveValid (szDrive$) AS INTEGER
- DECLARE FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) AS STRING
- DECLARE FUNCTION GetDOSMajorVersion AS INTEGER
- DECLARE FUNCTION GetDOSMinorVersion AS INTEGER
- DECLARE FUNCTION GetProcessorType AS INTEGER
- DECLARE FUNCTION GetFreeSpaceForDrive (szDrive$) AS LONG
- DECLARE FUNCTION HasMouseInstalled AS INTEGER
- DECLARE FUNCTION DoesFileExist (szFile$, mode%) AS INTEGER
- DECLARE FUNCTION DoesDirExist (szDir$) AS INTEGER
- DECLARE FUNCTION GetDateOfFile (szFile$) AS STRING
- DECLARE FUNCTION DoesIniSectionExist (szFile$, szSect$) AS INTEGER
- DECLARE FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) AS INTEGER
-
-
- '*************************************************************************
- FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) STATIC AS STRING
- '$ifdef DEBUG
- if FValidIniFile(szFile$) = 0 then
- n% = 1
- elseif szKey$ = "" then
- n% = 3
- else
- n% = 0
- end if
- if n% > 0 then
- BadArgErr n%, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
- end if
- '$endif ''DEBUG
-
- cb% = 512
- szBuf$ = STRING$(cb%, 32)
- cbRet% = CbGetIniKeyString(szFile$, szSect$, szKey$, szBuf$, cb%)
- GetIniKeyString = szBuf$
- '$ifdef DEBUG
- IF cbRet% >= cb% THEN
- StfApiErr saeOvfl, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
- ERROR STFERR
- END IF
- '$endif ''DEBUG
- szBuf$ = ""
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION IsDriveValid (szDrive$) STATIC AS INTEGER
- '$ifdef DEBUG
- if FValidDrive(szDrive$) = 0 then
- BadArgErr 1, "IsDriveValid", szDrive$
- end if
- '$endif ''DEBUG
- IsDriveValid = FIsValidDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION GetDOSMajorVersion STATIC AS INTEGER
- GetDOSMajorVersion = WGetDOSMajorVersion
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION GetDOSMinorVersion STATIC AS INTEGER
- GetDOSMinorVersion = WGetDOSMinorVersion
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION GetProcessorType STATIC AS INTEGER
- GetProcessorType = 0
- longTmp& = GetWinFlags()
- IF longTmp& AND WF_CPU486 THEN
- GetProcessorType = 4
- ELSEIF longTmp& AND WF_CPU386 THEN
- GetProcessorType = 3
- ELSEIF longTmp& AND WF_CPU286 THEN
- GetProcessorType = 2
- ELSEIF longTmp& AND WF_CPU186 THEN
- GetProcessorType = 1
- END IF
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION GetFreeSpaceForDrive (szDrive$) STATIC AS LONG
- '$ifdef DEBUG
- if FValidDrive(szDrive$) = 0 then
- BadArgErr 1, "GetFreeSpaceForDrive", szDrive$
- end if
- '$endif ''DEBUG
- GetFreeSpaceForDrive = LcbFreeDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION HasMouseInstalled STATIC AS INTEGER
- HasMouseInstalled = FHasMouseInstalled
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION DoesFileExist (szFileName$, mode%) STATIC AS INTEGER
- '$ifdef DEBUG
- if FValidFATPath(szFileName$) = 0 then
- BadArgErr 1, "DoesFileExist", szFileName$+", "+STR$(mode%)
- end if
- '$endif ''DEBUG
- DoesFileExist = FDoesFileExist(szFileName$, mode%)
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION DoesDirExist (szDir$) STATIC AS INTEGER
- '$ifdef DEBUG
- if FValidFATDir(szDir$) = 0 then
- BadArgErr 1, "DoesDirExist", szDir$
- end if
- '$endif ''DEBUG
- DoesDirExist = FDirExists(szDir$)
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION GetDateOfFile (szFile$) STATIC AS STRING
- '$ifdef DEBUG
- if FValidFATPath(szFile$) = 0 then
- BadArgErr 1, "GetDateOfFile", szFile$
- end if
- '$endif ''DEBUG
- cb% = 20
- szBuf$ = STRING$(cb%, 32)
- cbRet% = CbGetDateOfFile(szFile$, szBuf$, cb%)
- GetDateOfFile = szBuf$
- '$ifdef DEBUG
- IF cbRet% >= cb% THEN
- StfApiErr saeOvfl, "GetDateOfFile", szFile$
- ERROR STFERR
- END IF
- '$endif ''DEBUG
- szBuf$ = ""
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION DoesIniSectionExist (szFile$, szSect$) STATIC AS INTEGER
- '$ifdef DEBUG
- if FValidIniFile(szFile$) = 0 then
- BadArgErr 1, "DoesIniSectionExist", szFile$+", "+szSect$
- end if
- '$endif ''DEBUG
- DoesIniSectionExist = FDoesIniSectionExist(szFile$, szSect$)
- END FUNCTION
-
-
- '*************************************************************************
- FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) STATIC AS INTEGER
- '$ifdef DEBUG
- if FValidIniFile(szFile$) = 0 then
- n% = 1
- elseif szKey$ = "" then
- n% = 3
- else
- n% = 0
- end if
- if n% > 0 then
- BadArgErr n%, "DoesIniKeyExist", szFile$+", "+szSect$+", "+szKey$
- end if
- '$endif ''DEBUG
-
- DoesIniKeyExist = FDoesIniKeyExist(szFile$, szSect$, szKey$)
- END FUNCTION
-
-